klotz: python* + machine learning*

0 bookmark(s) - Sort by: Date ↓ / Title / - Bookmarks from other users for this tag

  1. The article showcases concise Python code snippets (one-liners) for common machine learning tasks like data splitting, standardization, model training (linear regression, logistic regression, decision tree, random forest), and prediction, leveraging libraries such as scikit-learn.

    | **#** | **One-Liner** | **Description** | **Library** | **Use Case** |
    |-----|-----------------------------------------------------|-------------------------------------------------------------------------------------|-------------------|-------------------------------------------------|
    | 1 | `from sklearn.datasets import load_iris; X, y = load_iris(return_X_y=True)` | Loads the Iris dataset, a classic for classification. | scikit-learn | Loading a standard dataset. |
    | 2 | `from sklearn.model_selection import train_test_split; X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1)` | Splits the dataset into training and testing sets. | scikit-learn | Preparing data for model training & evaluation.|
    | 3 | `from sklearn.linear_model import LogisticRegression; model = LogisticRegression(random_state=1)` | Creates a Logistic Regression model. | scikit-learn | Binary Classification. |
    | 4 | `model.fit(X_train, y_train)` | Trains the Logistic Regression model. | scikit-learn | Model training. |
    | 5 | `y_pred = model.predict(X_test)` | Predicts labels for the test dataset. | scikit-learn | Making predictions. |
    | 6 | `from sklearn.metrics import accuracy_score; accuracy = accuracy_score(y_test, y_pred)` | Calculates the accuracy of the model. | scikit-learn | Evaluating model performance. |
    | 7 | `import pandas as pd; df = pd.DataFrame(X, columns=iris.feature_names)` | Creates a Pandas DataFrame from the Iris dataset features. | Pandas | Data manipulation and analysis. |
    | 8 | `df 'target' » = y` | Adds the target variable to the DataFrame. | Pandas | Combining features and labels. |
    | 9 | `df.head()` | Displays the first few rows of the DataFrame. | Pandas | Inspecting the data. |
    | 10 | `df.describe()` | Generates descriptive statistics of the DataFrame. | Pandas | Understanding data distribution. |
  2. Optuna is an open-source hyperparameter optimization framework designed to automate the hyperparameter search process for machine learning models. It supports various frameworks like TensorFlow, Keras, Scikit-Learn, XGBoost, and LightGBM, offering features like eager search spaces, state-of-the-art algorithms, and easy parallelization.
  3. This example demonstrates Density-Based Spatial Clustering of Applications with Noise (DBSCAN) using scikit-learn, showing how to generate synthetic clusters, compute DBSCAN clustering, and visualize the results, including core and non-core samples.
  4. This article details a method for training large language models (LLMs) for code generation using a secure, local WebAssembly-based code interpreter and reinforcement learning with Group Relative Policy Optimization (GRPO). It covers the setup, training process, evaluation, and potential next steps.
  5. SmolVLM2 represents a shift in video understanding technology by introducing efficient models that can run on various devices, from phones to servers. The release includes models of three sizes (2.2B, 500M, and 256M) with Python and Swift API support. These models offer video understanding capabilities with reduced memory consumption, supported by a suite of demo applications for practical use.
  6. This tutorial demonstrates how to fine-tune the Llama-2 7B Chat model for Python code generation using QLoRA, gradient checkpointing, and SFTTrainer with the Alpaca-14k dataset.
  7. "An example of simultaneously optimizing two policies for two adversarial agents, looking specifically at the cat and mouse game."

    The article explores developing strategies for two players with conflicting goals, using methods like game trees, reinforcement learning, and hill-climbing optimization. The focus is on determining optimal policies for each player to either catch or evade capture, considering board configurations and player turn orders. The article further details how hill climbing is applied to improve strategies incrementally, using variations in policies to evaluate and enhance performance over numerous iterations.
  8. Pete Warden shares his experience and knowledge about the memory layout of the Raspberry Pi Pico board, specifically the RP2040 microcontroller. He encountered baffling bugs while updating TensorFlow Lite Micro and traced them to poor understanding of the memory layout. The article provides detailed insights into the physical and RAM layouts, stack behavior, and potential pitfalls.
  9. A step-by-step guide on understanding and implementing t-SNE for visualizing high-dimensional data using Python.
  10. ASCVIT V1 aims to make data analysis easier by automating statistical calculations, visualizations, and interpretations.

    Includes descriptive statistics, hypothesis tests, regression, time series analysis, clustering, and LLM-powered data interpretation.

    - Accepts CSV or Excel files. Provides a data overview including summary statistics, variable types, and data points.
    - Histograms, boxplots, pairplots, correlation matrices.
    - t-tests, ANOVA, chi-square test.
    - Linear, logistic, and multivariate regression.
    - Time series analysis.
    - k-means, hierarchical clustering, DBSCAN.

    Integrates with an LLM (large language model) via Ollama for automated interpretation of statistical results.

Top of the page

First / Previous / Next / Last / Page 2 of 0 SemanticScuttle - klotz.me: Tags: python + machine learning

About - Propulsed by SemanticScuttle